<script>
function change_allmoney(){
var money=$(".layer_allmoney .price_m").html(),vhtml='<div class="layui-form-item"><label class="layui-form-label">服务价格</label><div class="layui-inline"><div class="layui-form-mid orange">￥'+money+'</div></div></div>';
$("input[name=money]").val(parseInt(money));
if($(".layer_allmoney .Edition").length>0){
	var $data=$(".layer_allmoney .cur");
if($data.length<=0){alert("请选择您要购买的服务版本！");return false;}
	vhtml='<div class="layui-form-item"><label class="layui-form-label">服务版本</label><div class="layui-inline"><div class="layui-form-mid blue">'+$data.attr("title")+'</div></div></div>'+vhtml;
	$("input[name=edition]").val($data.attr("title"));
}else{
	$("input[name=edition]").val('');
}

if($(".layer_allmoney .ly_num").length>0){
var num=parseInt($("#addred_num").val());
	vhtml+='<div class="layui-form-item"><label class="layui-form-label">购买数量</label><div class="layui-inline"><div class="layui-form-mid"><b>'+num+'</b> 件</div></div></div>';
}else{
	var num=1;
}

if(num>1){
vhtml+='<div class="layui-form-item"><label class="layui-form-label">合计</label><div class="layui-inline"><div class="layui-form-mid orange b">￥<b>'+toDecimal2(num*parseInt(money))+'</b></div></div></div>';
}
$("input[name=piece]").val(num);
$(".serve_cart").html(vhtml)
layer.close(layer.index);
}
</script>
<div class="layer_allmoney">
 <ul>
  <li class="l1">
   所属服务：
  </li>
  <li class="l2 tit">
   <a href="{:c_url($serve.id,'serve')}" target="_blank" >{$serve.tit}</a>
  </li>
  <li class="l1">
   服务价格：
  </li>
  <li class="l2">
  <div class="price"><span>￥</span><em class="price_m">{:money_tmoney($serve)}</em></div>
  <input type="button" class="layui-btn layui-btn-danger" onclick="change_allmoney();" value="确定选择" />
  </li>
  {if $serve.tmoney==1}<li class="l1">
  服务版本：
  </li>
  <li class="l2 Edition">
  {volist name="moneydata" id="v"}
    <a data="{$v.money}.00" title='{$v.ydes}'>{$v.ydes}<i class='iconfont'>&#xe64e;</i></a>{/volist}
    </li>{/if}
 {if $serve.piece==1}<li class="l1">
 购买数量：
 </li>
 <li class="l2">
 <input type="button" class="addred" value="-">
 <input type="text" name="ly_num" data='piece' id="addred_num" onkeyup='if(this.value<1){this.value=1;}' class="p_number ly_num" value="1">
  <input type="button" class="addred" value="+">&nbsp;&nbsp;件
  </li>{/if}
   <span class="Price_range" style="display:none;">{:money_tmoney($serve)}</span>
</div>